



# NumPy 数组类似于 Python 列，它们都用作容器。
# Numpy的优点，算术计算、多维。

import numpy as np

a = [1, 2, 3]
print(a*2)

a = np.array([1, 2, 3])
b = a*2
print(b)
for i in b:
    print(i)


def pySum():
    a = [0,1,2,3,4]
    b = [9,8,7,6,5]
    c = []
    for i in range(len(a)):
        c.append(a[i]**2 + b[i]**3)
    return c

print(pySum())
# [729, 513, 347, 225, 141]


def npSum():
    a = np.array([0,1,2,3,4])
    b = np.array([9,8,7,6,5])
    c = a**2 + b**3
    return c

print(npSum())
# [729 513 347 225 141]

# https://blog.csdn.net/weixin_42608414/article/details/128774964
# https://blog.csdn.net/qq_37289115/article/details/108528172